package com.tech.doggtv.action;

import com.tech.doggtv.comm.SDCardFileUtils;

import java.io.File;
import java.util.ArrayList;

/**
 * @Description: ${todo}(这里用一句话描述这个方法的作用)
 * Created by jl_luo on 2015/9/13.
 * email：dongyangluo@126.com
 */
public class ProgramsAction {
    /**
     * 得到某个目录下的所有视频文件的名称
     * @param columns
     * @return
     */
    public static File[] getPrograms(String columns){
        File targetFile = SDCardFileUtils.getSDCardVideoPath(columns);
        File[] programs = targetFile.listFiles();
        return programs;
    }


    public static int getNextPlayPos(int currentPos, int programsLength){
        int nextPos;
        if(currentPos>= programsLength-1){
            nextPos =0;
        }else{
            nextPos = currentPos+1;
        }


        return nextPos;
    }
}
